package org.batatasframework.chart.columns;

public class ColumnAxisAnnually extends AbstractValueColumn<String> implements ChartColumnAxis{
	private final int annualIndex;
	private final String annualName;

	public ColumnAxisAnnually(String name, int annualIndex, String annualName) {
		super(name);
		this.annualIndex = annualIndex;
		this.annualName = annualName;
	}

	public ColumnAxisAnnually(String name, int annualIndex) {
		this(name, annualIndex, "年");
	}

	@Override
	protected String internalParseValue(Object[] row) {
		return annualIndex < row.length ? row[annualIndex] + annualName : null;
	}
}
